/**
 * 配置编译环境和线上环境之间的切换
 * 
 * baseUrl: 域名地址
 * routerMode: 路由模式
 * imgBaseUrl: 图片所在域名地址
 * socketUrl: 
 */
import env from './env'

let baseUrl = '';
let routerMode = 'hash';
let imgBaseUrl = '';
let socketUrl = ''
let apiUrl = ''       // 后台接口api
let host = window.location.host;
let ip = host.split(":")[0];
let rtmp = ''      // 用于开启直播后

if (env == 'development') {
  console.log(process.env.NODE_ENV)
  // socketUrl = 'http://localhost:3335'
  // apiUrl = 'http://localhost:3333'
  // 测试视频通话开启
  socketUrl = 'https://' + ip + ':3335'
  apiUrl = 'https://' + ip + ':3333'
  rtmp = 'rtmp://' + ip + '/live'
} else if (env == 'production') {
  baseUrl = '/pet/pet_h5/';
  console.log(process.env.NODE_ENV)
}

export {
  baseUrl,
  routerMode,
  imgBaseUrl,
  socketUrl,
  apiUrl,
  rtmp
}